package cn.smile.dao.common;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import cn.smile.entity.common.Student;

/**
 * 学生信息操作dao类
 */
@SuppressWarnings("JpaQlInspection")
@Repository
public interface StudentDao extends JpaRepository<Student, Long> {

    /**
     * 根据学号查询
     */
    Student findBySn(String sn);

    /**
     * 根据id查找
     */
    @Query("select s from Student s where id = :id")
    Student find(@Param("id") Long id);
}
